home *** CD-ROM | disk | FTP | other *** search
/ 100 Great Games for Palm OS 2 / PalmV2012301.ISO / puzzles / Pilot Mines / src / mine.h < prev    next >
C/C++ Source or Header  |  1999-06-01  |  1KB  |  49 lines

  1. #ifndef _MINE_H
  2. #define _MINE_H
  3.  
  4. #ifdef OLDGCC
  5. /* 
  6.  * a bug in the gcc port -- it doesn't save %a4, as it isn't 
  7.  * supposed to be destroyed; SysTraps() however do this casually;
  8.  * place these macros in EventHandler routines and callback functions.
  9.  *
  10.  * the egcs port doesn't have it anymore :-)
  11.  */
  12. register void *reg_a4 asm("%a4");
  13. #  define CALLBACK_PROLOGUE \
  14.     void *save_a4 = reg_a4; asm("move.l %%a5,%%a4; sub.l #edata,%%a4" : :);
  15. #  define CALLBACK_EPILOGUE reg_a4 = save_a4;
  16. #else
  17. #  define CALLBACK_PROLOGUE
  18. #  define CALLBACK_EPILOGUE
  19. #endif
  20.           
  21. #define WIDTH           16
  22. #define HEIGHT          14
  23. #define NAMLEN          11
  24.  
  25. typedef int (*func) (SWord, SWord);
  26.  
  27. typedef struct {
  28.   int  version;
  29.   Byte options;
  30.   Byte level;
  31.   Byte minefield[WIDTH][HEIGHT];
  32.   Byte done;
  33.   Byte seconds;
  34.   struct {
  35.     char name[NAMLEN];
  36.     int score;
  37.     ULong date;
  38.   } hscore[4][5];
  39. } Game;
  40.  
  41. extern long score;
  42. extern Game game;
  43.  
  44. // Insert by Lucas Bremgartner
  45. enum { IsRunning, IsWon, IsLost, IsFinishedWon, IsFinishedLost, IsToBeStarted, Restart, HighScoreWon, HighScoreLost };
  46. // Insert by Lucas Bremgartner (End)
  47.  
  48. #endif
  49.